track-changes.el: Minor changes for version 1.0
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 17 Apr 2024 01:57:05 +0000 (21:57 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 17 Apr 2024 01:57:05 +0000 (21:57 -0400)
commita33ab7565e20d9c04731491f6ae38a8d35be729f
treed1cbd75df23859968ea4a8769e91f3846c1d57df
parent484b0979099d91e286c248e32b2f693111fac2ad
track-changes.el: Minor changes for version 1.0

Arrange for the library to be usable on older Emacsen, which
includes reducing the noise when `before/after-change-functions`
are badly paired or missing.
Also, since the signal function receives the distance (for `:disjoint`),
we don't need `track-changes--disjoint-threshold`: the signal
function can simply do nothing when the distance is smaller than
the threshold it wants to use.

* lisp/emacs-lisp/track-changes.el: Prepare header for ELPA.
(track-changes--tracker, track-changes--state): Don't use `:noinline`,
so as to be compatible with Emacs<27.
(track-changes-record-errors): New variable.
(track-changes--recover-from-error): Use it.  Record only the last 20
keys and the last 50 stack frames in the error log.
(track-changes--disjoint-threshold): Delete variable.
(track-changes--before): Don't use it any more.

* lisp/progmodes/eglot.el (eglot--track-changes-signal):
Coalesce disjoint changes nearer than what used to be coalesced because of
`track-changes--disjoint-threshold`.
lisp/emacs-lisp/track-changes.el
lisp/progmodes/eglot.el